﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_InsertLocation')
	BEGIN
		DROP  Procedure  esf_sso.P_InsertLocation
	END

GO

CREATE Procedure esf_sso.P_InsertLocation
	@pCityID				BIGINT = NULL
	,@pCountryID			BIGINT = NULL
	,@pName					VARCHAR (100)
	,@pCityName				VARCHAR (60) = NULL
	,@pPhoneNumber			VARCHAR (30) = NULL
	,@pCellPhoneNumber		VARCHAR (30) = NULL
	,@pAddress				VARCHAR (100) = NULL
	
	,@pID					BIGINT OUTPUT
AS

	INSERT INTO [esf_sso].[Location]
		([CityID]
		,[CountryID]
		,[Name]
		,CityName
		,[PhoneNumber]
		,[CellPhoneNumber]
		,[Address])
	 VALUES
		(@pCityID
		,@pCountryID
		,@pName
		,@pCityName
		,@pPhoneNumber
		,@pCellPhoneNumber
		,@pAddress)
  
	SET @pID = @@IDENTITY
           
GO